<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
namespace AlibabaCloud\Client\Clients;

trait ManageTrait
{
    public function getSessionCredential($timeout = \AlibabaCloud\Client\Request\Request::TIMEOUT, $connectTimeout = \AlibabaCloud\Client\Request\Request::CONNECT_TIMEOUT)
    {
        get_class($this->credential);
        switch (get_class($this->credential)) {
            case "AlibabaCloud\\Client\\Credentials\\EcsRamRoleCredential":
                return (new \AlibabaCloud\Client\Credentials\Providers\EcsRamRoleProvider($this))->get();
                break;
            case "AlibabaCloud\\Client\\Credentials\\RamRoleArnCredential":
                return (new \AlibabaCloud\Client\Credentials\Providers\RamRoleArnProvider($this))->get($timeout, $connectTimeout);
                break;
            case "AlibabaCloud\\Client\\Credentials\\RsaKeyPairCredential":
                return (new \AlibabaCloud\Client\Credentials\Providers\RsaKeyPairProvider($this))->get($timeout, $connectTimeout);
                break;
            default:
                return $this->credential;
        }
    }
    public function asGlobalClient()
    {
        return $this->asDefaultClient();
    }
    public function asDefaultClient()
    {
        return $this->name(\AlibabaCloud\Client\Credentials\Providers\CredentialsProvider::getDefaultName());
    }
    public function name($name)
    {
        \AlibabaCloud\Client\Filter\Filter::name($name);
        return \AlibabaCloud\Client\AlibabaCloud::set($name, $this);
    }
    public function isDebug()
    {
        if(isset($this->options["debug"])) {
            return $this->options["debug"] === true && PHP_SAPI === "cli";
        }
        return false;
    }
}

?>